<?php

$selectedcity = '';
if (isset($_POST['selectedcity']))
    $selectedcity = $_POST['selectedcity'];

include('inc/init.php');

$smarty->template_dir = 'templates';
$smarty->assign('title', $title);

$sql = "select * from ats_partners";
if (($selectedcity != 'ALL') && ($selectedcity != ''))
    $sql .= " where cityname like '%".$selectedcity."%'";

$sql .= " order by partnername";

$partners = $db->prepare($sql);
$partners->execute();
$partners->setFetchMode(PDO::FETCH_ASSOC);

$smarty->assign('partners', $partners);

$smarty->display('getpartners.tpl');

?>
